package com.xiaoyuan.service.impl;

import com.xiaoyuan.dao.Student;
import com.xiaoyuan.minicore.aop.annotation.PointCut;
import com.xiaoyuan.minicore.core.ConfigHelper;
import com.xiaoyuan.minicore.dao.DBHelper;
import com.xiaoyuan.minicore.ioc.annotation.Bean;
import com.xiaoyuan.minicore.tx.annotation.Transaction;
import com.xiaoyuan.service.StudentService;
import com.xiaoyuan.service.StudentService2;

/**
 * @Auther: xiaoyuan
 * @Date: 2020/4/28
 * @Description:
 */
@Bean
public class StudentService2Impl implements StudentService2 {


    @Override
    @Transaction
    @PointCut
    public int insertStudent(String name, String xxHa) throws IllegalAccessException {
        String sql = ConfigHelper.getString("insert.student");
        int result = DBHelper.update(sql,name,xxHa);
        if(false){
            throw  new IllegalAccessException("StudentService2 error");
        }
        return result;
    }
}
